.class Lcom/nemustech/regina/ReginaWallpaperSelector$WallpaperImageAdapter;
.super Landroid/widget/BaseAdapter;
.source "ReginaWallpaperSelector.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/nemustech/regina/ReginaWallpaperSelector;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "WallpaperImageAdapter"
.end annotation


# instance fields
.field private mContext:Landroid/content/Context;

.field mWallpaperImageBackground:I

.field final synthetic this$0:Lcom/nemustech/regina/ReginaWallpaperSelector;


# direct methods
.method public constructor <init>(Lcom/nemustech/regina/ReginaWallpaperSelector;Landroid/content/Context;)V
    .locals 13
    .parameter
    .parameter "context"

    .prologue
    const v12, 0x7f0700f3

    const v11, 0x7f0700f2

    const/4 v10, 0x2

    const/4 v9, 0x1

    const/4 v8, 0x0

    .line 42
    iput-object p1, p0, Lcom/nemustech/regina/ReginaWallpaperSelector$WallpaperImageAdapter;->this$0:Lcom/nemustech/regina/ReginaWallpaperSelector;

    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 43
    iput-object p2, p0, Lcom/nemustech/regina/ReginaWallpaperSelector$WallpaperImageAdapter;->mContext:Landroid/content/Context;

    .line 45
    sget-object v5, Lcom/nemustech/regina/R$styleable;->WallpaperSelector:[I

    invoke-virtual {p1, v5}, Lcom/nemustech/regina/ReginaWallpaperSelector;->obtainStyledAttributes([I)Landroid/content/res/TypedArray;

    move-result-object v0

    .line 46
    .local v0, a:Landroid/content/res/TypedArray;
    invoke-virtual {v0, v8, v8}, Landroid/content/res/TypedArray;->getResourceId(II)I

    move-result v5

    iput v5, p0, Lcom/nemustech/regina/ReginaWallpaperSelector$WallpaperImageAdapter;->mWallpaperImageBackground:I

    .line 48
    invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V

    .line 50
    invoke-static {p1}, Lcom/nemustech/regina/ReginaWallpaperSelector;->access$000(Lcom/nemustech/regina/ReginaWallpaperSelector;)Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/String;->length()I

    move-result v5

    if-lez v5, :cond_4

    .line 51
    const/4 v3, 0x0

    .local v3, resId:I
    const/4 v1, 0x0

    .line 53
    .local v1, cnt:I
    :try_start_0
    invoke-virtual {p1}, Lcom/nemustech/regina/ReginaWallpaperSelector;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v5

    invoke-static {p1}, Lcom/nemustech/regina/ReginaWallpaperSelector;->access$000(Lcom/nemustech/regina/ReginaWallpaperSelector;)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Landroid/content/pm/PackageManager;->getResourcesForApplication(Ljava/lang/String;)Landroid/content/res/Resources;

    move-result-object v5

    invoke-static {p1, v5}, Lcom/nemustech/regina/ReginaWallpaperSelector;->access$102(Lcom/nemustech/regina/ReginaWallpaperSelector;Landroid/content/res/Resources;)Landroid/content/res/Resources;
    :try_end_0
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    .line 60
    :cond_0
    :goto_0
    const-string v5, "%s%d"

    new-array v6, v10, [Ljava/lang/Object;

    iget-object v7, p0, Lcom/nemustech/regina/ReginaWallpaperSelector$WallpaperImageAdapter;->mContext:Landroid/content/Context;

    invoke-virtual {v7, v11}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v7

    aput-object v7, v6, v8

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v7

    aput-object v7, v6, v9

    invoke-static {v5, v6}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    .line 61
    .local v2, name:Ljava/lang/String;
    iget-object v5, p0, Lcom/nemustech/regina/ReginaWallpaperSelector$WallpaperImageAdapter;->mContext:Landroid/content/Context;

    invoke-virtual {v5, v12}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v4

    .line 62
    .local v4, type:Ljava/lang/String;
    invoke-static {p1}, Lcom/nemustech/regina/ReginaWallpaperSelector;->access$100(Lcom/nemustech/regina/ReginaWallpaperSelector;)Landroid/content/res/Resources;

    move-result-object v5

    invoke-static {p1}, Lcom/nemustech/regina/ReginaWallpaperSelector;->access$000(Lcom/nemustech/regina/ReginaWallpaperSelector;)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v2, v4, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I

    move-result v3

    .line 63
    if-eqz v3, :cond_1

    .line 64
    invoke-static {p1}, Lcom/nemustech/regina/ReginaWallpaperSelector;->access$200(Lcom/nemustech/regina/ReginaWallpaperSelector;)Ljava/util/ArrayList;

    move-result-object v5

    new-instance v6, Ljava/lang/Integer;

    invoke-direct {v6, v3}, Ljava/lang/Integer;-><init>(I)V

    invoke-virtual {v5, v6}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 66
    :cond_1
    add-int/lit8 v1, v1, 0x1

    .line 67
    if-nez v3, :cond_0

    .line 69
    const/4 v1, 0x0

    .line 72
    :cond_2
    const-string v5, "%s%ds"

    new-array v6, v10, [Ljava/lang/Object;

    iget-object v7, p0, Lcom/nemustech/regina/ReginaWallpaperSelector$WallpaperImageAdapter;->mContext:Landroid/content/Context;

    invoke-virtual {v7, v11}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v7

    aput-object v7, v6, v8

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v7

    aput-object v7, v6, v9

    invoke-static {v5, v6}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    .line 73
    iget-object v5, p0, Lcom/nemustech/regina/ReginaWallpaperSelector$WallpaperImageAdapter;->mContext:Landroid/content/Context;

    invoke-virtual {v5, v12}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v4

    .line 74
    invoke-static {p1}, Lcom/nemustech/regina/ReginaWallpaperSelector;->access$100(Lcom/nemustech/regina/ReginaWallpaperSelector;)Landroid/content/res/Resources;

    move-result-object v5

    invoke-static {p1}, Lcom/nemustech/regina/ReginaWallpaperSelector;->access$000(Lcom/nemustech/regina/ReginaWallpaperSelector;)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v2, v4, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I

    move-result v3

    .line 75
    if-eqz v3, :cond_3

    .line 76
    invoke-static {p1}, Lcom/nemustech/regina/ReginaWallpaperSelector;->access$300(Lcom/nemustech/regina/ReginaWallpaperSelector;)Ljava/util/ArrayList;

    move-result-object v5

    new-instance v6, Ljava/lang/Integer;

    invoke-direct {v6, v3}, Ljava/lang/Integer;-><init>(I)V

    invoke-virtual {v5, v6}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 78
    :cond_3
    add-int/lit8 v1, v1, 0x1

    .line 79
    if-nez v3, :cond_2

    .line 81
    .end local v1           #cnt:I
    .end local v2           #name:Ljava/lang/String;
    .end local v3           #resId:I
    .end local v4           #type:Ljava/lang/String;
    :cond_4
    return-void

    .line 54
    .restart local v1       #cnt:I
    .restart local v3       #resId:I
    :catch_0
    move-exception v5

    goto :goto_0
.end method


# virtual methods
.method public getCount()I
    .locals 1

    .prologue
    .line 85
    iget-object v0, p0, Lcom/nemustech/regina/ReginaWallpaperSelector$WallpaperImageAdapter;->this$0:Lcom/nemustech/regina/ReginaWallpaperSelector;

    invoke-static {v0}, Lcom/nemustech/regina/ReginaWallpaperSelector;->access$300(Lcom/nemustech/regina/ReginaWallpaperSelector;)Ljava/util/ArrayList;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 1
    .parameter "position"

    .prologue
    .line 90
    const/4 v0, 0x0

    return-object v0
.end method

.method public getItemId(I)J
    .locals 2
    .parameter "position"

    .prologue
    .line 95
    const-wide/16 v0, 0x0

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 5
    .parameter "position"
    .parameter "convertView"
    .parameter "parent"

    .prologue
    .line 100
    if-nez p2, :cond_1

    .line 101
    new-instance v0, Landroid/widget/ImageView;

    iget-object v2, p0, Lcom/nemustech/regina/ReginaWallpaperSelector$WallpaperImageAdapter;->mContext:Landroid/content/Context;

    invoke-direct {v0, v2}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    .line 103
    .local v0, imgView:Landroid/widget/ImageView;
    iget-object v2, p0, Lcom/nemustech/regina/ReginaWallpaperSelector$WallpaperImageAdapter;->this$0:Lcom/nemustech/regina/ReginaWallpaperSelector;

    invoke-static {v2}, Lcom/nemustech/regina/ReginaWallpaperSelector;->access$300(Lcom/nemustech/regina/ReginaWallpaperSelector;)Ljava/util/ArrayList;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/Integer;

    .line 107
    .local v1, resId:Ljava/lang/Integer;
    invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I

    move-result v2

    if-eqz v2, :cond_0

    .line 108
    iget-object v2, p0, Lcom/nemustech/regina/ReginaWallpaperSelector$WallpaperImageAdapter;->this$0:Lcom/nemustech/regina/ReginaWallpaperSelector;

    invoke-static {v2}, Lcom/nemustech/regina/ReginaWallpaperSelector;->access$100(Lcom/nemustech/regina/ReginaWallpaperSelector;)Landroid/content/res/Resources;

    move-result-object v2

    invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I

    move-result v3

    invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 111
    :cond_0
    new-instance v2, Landroid/widget/Gallery$LayoutParams;

    iget-object v3, p0, Lcom/nemustech/regina/ReginaWallpaperSelector$WallpaperImageAdapter;->this$0:Lcom/nemustech/regina/ReginaWallpaperSelector;

    invoke-static {v3}, Lcom/nemustech/regina/ReginaWallpaperSelector;->access$400(Lcom/nemustech/regina/ReginaWallpaperSelector;)I

    move-result v3

    iget-object v4, p0, Lcom/nemustech/regina/ReginaWallpaperSelector$WallpaperImageAdapter;->this$0:Lcom/nemustech/regina/ReginaWallpaperSelector;

    invoke-static {v4}, Lcom/nemustech/regina/ReginaWallpaperSelector;->access$500(Lcom/nemustech/regina/ReginaWallpaperSelector;)I

    move-result v4

    invoke-direct {v2, v3, v4}, Landroid/widget/Gallery$LayoutParams;-><init>(II)V

    invoke-virtual {v0, v2}, Landroid/widget/ImageView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 112
    iget v2, p0, Lcom/nemustech/regina/ReginaWallpaperSelector$WallpaperImageAdapter;->mWallpaperImageBackground:I

    invoke-virtual {v0, v2}, Landroid/widget/ImageView;->setBackgroundResource(I)V

    .line 114
    move-object p2, v0

    .line 117
    .end local v0           #imgView:Landroid/widget/ImageView;
    .end local v1           #resId:Ljava/lang/Integer;
    :cond_1
    return-object p2
.end method
